﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Transiteers.Models
{
    public partial class TransiteersDB
    {

        public static User Current { get; set; }

        public User GetUser(int userID)
        {
            return BaseDB.Users.FirstOrDefault(u => u.ID == userID);
        }

        public bool CheckLogin(string username, string password)
        {
            return BaseDB.Users.FirstOrDefault(u => u.Username == username && u.Password == password) != null;
        }

        public void Add(User user)
        {
            BaseDB.Users.Add(user);
            BaseDB.SaveChanges();
        }

        public void Remove(User user)
        {
            BaseDB.Users.Remove(user);
        }

    }
}